<template>
    <div class="chart">
        <ul class="user_Overview flex" v-if="pageflag">
            <li class="user_Overview-item" style="color: #00fdfa">
                <div class="user_Overview_nums allnum ">
                    <dv-digital-flop :config="config" style="width:100%;height:100%;" />
                </div>
                <p>已完成</p>
            </li>
            <li class="user_Overview-item" style="color: #07f7a8">
                <div class="user_Overview_nums online">
                    <dv-digital-flop :config="onlineconfig" style="width:100%;height:100%;" />
                </div>
                <p>未指派</p>
            </li>
            <li class="user_Overview-item" style="color: #e3b337">
                <div class="user_Overview_nums offline">
                    <dv-digital-flop :config="offlineconfig" style="width:100%;height:100%;" />

                </div>
                <p>处理中</p>
            </li>
            <li class="user_Overview-item" style="color: #f5023d">
                <div class="user_Overview_nums laramnum">
                    <dv-digital-flop :config="laramnumconfig" style="width:100%;height:100%;" />
                </div>
                <p>待确认</p>
            </li>
        </ul>
    </div>
</template>

<script>
// import "@/assets/css/index.scss"
import { getsystem } from '@/api/echarts'
let style = {
    fontSize: 24
}
export default {
    data() {
        return {
            options: {},
            userOverview: {
                alarmNum: 0,
                offlineNum: 0,
                onlineNum: 0,
                totalNum: 0,
            },
            pageflag: true,
            config: {
                number: [100],
                content: '{nt}',
                style: {
                    ...style,
                    // stroke: "#00fdfa",
                    fill: "#00fdfa",
                },
            },
            onlineconfig: {
                number: [0],
                content: '{nt}',
                style: {
                    ...style,
                    // stroke: "#07f7a8",
                    fill: "#07f7a8",
                },
            },
            offlineconfig: {
                number: [0],
                content: '{nt}',
                style: {
                    ...style,
                    // stroke: "#e3b337",
                    fill: "#e3b337",
                },
            },
            laramnumconfig: {
                number: [0],
                content: '{nt}',
                style: {
                    ...style,
                    // stroke: "#f5023d",
                    fill: "#f5023d",
                },
            }

        };
    },
    filters: {
        numsFilter(msg) {
            return msg || 0;
        },
    },
    created() {
        getsystem().then((res) => {
            if (!this.timer) {
                console.log("设备总览", res);
            }

            this.userOverview = res.msg;
            this.onlineconfig = {
                ...this.onlineconfig,
                number: [res.msg.complete]
            }
            this.config = {
                ...this.config,
                number: [res.msg.unAssign]
            }
            this.offlineconfig = {
                ...this.offlineconfig,
                number: [res.msg.inHandle]
            }
            this.laramnumconfig = {
                ...this.laramnumconfig,
                number: [res.msg.confirm]
            }
            this.switper()

        });
    },
    mounted() {
    },
    beforeDestroy() {


    },
    methods: {

    },
};
</script>
<style lang='scss' scoped>
.chart {
    height: 3rem;
}

.user_Overview {
    display: flex;

    li {
        flex: 1;

        p {
            text-align: center;
            height: 16px;
            font-size: 16px;
        }

        .user_Overview_nums {

            width: 100px;
            height: 100px;
            text-align: center;
            line-height: 100px;
            font-size: 22px;
            margin: 0.5rem auto 0.15rem;
            background-size: cover;
            background-position: center center;
            position: relative;

            &::before {
                content: '';
                position: absolute;
                width: 100%;
                height: 100%;
                top: 0;
                left: 0;
            }

            &.bgdonghua::before {
                animation: rotating 14s linear infinite;
            }
        }

        .allnum {
       

            // background-image: url("../../assets/img/left_top_lan.png");
            &::before {
                background-image: url("../../assets/img/left_top_lan.png");
                 background-repeat: no-repeat;
            }
        }

        .online {
            &::before {
                background-image: url("../../assets/img/left_top_lv.png");
                background-repeat: no-repeat;
            }
        }

        .offline {
            &::before {
                background-image: url("../../assets/img/left_top_huang.png");
                background-repeat: no-repeat;
            }
        }

        .laramnum {
            &::before {
                background-image: url("../../assets/img/left_top_hong.png");
                background-repeat: no-repeat;
            }
        }
    }
}
</style>